<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>全局对象</title>
</head>

<body>
    <p>在 HTML 中 <b>this</b> 的值, 在全局函数是一个 window 对象。</p>
    <p id="demo"></p>
    <script>
        function myFunction() {
            return this;
        }
        document.getElementById("demo").innerHTML = myFunction(); 
    </script>
</body>

</html>